<?php
//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//
// DLMan by Shedd Technologies International		  				//
// http://www.dlman.com | info@dlman.com							//
// Copyright 2003 by STI, All rights reserved.						//
// ---------------------------------------------------------------- //
// Usage of this software is governed by the terms of GPL. 	    	//
//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//

/*
	-	Order New Products
	-	Download Purchased Products DONE
	-	Change Password DONE
	-	Edit Information DONE
	-	LOGOUT DONE
	- 	Customer Information, News on Main Page (per product) DONE
*/
//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\
//INITIALIZATION
require_once("global.php");
menu();
if(!isset($message)){
	$message=check();
}
global $content;
$content="";
if(!isset($action)){
	//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\
	//CONTENT GENERATION
			///////////////////////////////////////////////////////////////////
			//check to see if a page is set for inclusion
			if(!isset($loc)){
				include("main.php");
			}//end no page specified
			else{
				if($loc=="mem_down"){
					//load member download page
					include("download.php");
				}
				elseif($loc=="mem_purch"){
					//load purchase products
					include("purchase.php");
				}
				elseif($loc=="pref"){
					//load preferences screen
					include("user_preferences.php");
				}
			}//end else
		///////////////////////////////////////////////////////////////////
	//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\
	//PAGE DELIVERY
	ob_start();
	/*	TEMPLATE THIS */
	$output=sheader();
	$output.=parse(template("membersection"),$message,$menu,$content);
	$output.=$config->copypow;
	$output.=footer();
	$data = addslashes($output);
	eval("echo stripslashes(\"$data\");");
	$final=ob_get_contents();
	ob_end_clean();
	print $final;
	//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\
}//end no action
elseif($action=="OTHERACTION"){
	//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\
	
	//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\
}//end action==OTHER ACTION

/*
	Parse the template and replace variables with values
*/
function parse($code,$message,$menu,$content){
	global $PHP_SELF,$config;
		$code=str_replace("{title}",$config->cs['title'],$code);//$title
	$code=str_replace("{message}",$message,$code);//variable set by some operations
	$code=str_replace("{menu}",$menu,$code);//menu is a global variable set in menu()
	$code=str_replace("{content}",$content,$code);//content is a global variable set in external files
	return $code;
}
?>
